<?php

use Illuminate\Support\Facades\Route;
use Modules\Shop\Http\Controllers\BrandController;
use Modules\Shop\Http\Controllers\CategoryController;
use Modules\Shop\Http\Controllers\DeliveryController;
use Modules\Shop\Http\Controllers\OrderController;
use Modules\Shop\Http\Controllers\SkuController;
use Modules\Shop\Http\Controllers\SpecController;
use Modules\Shop\Http\Controllers\SpuController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::group(['prefix' => '/shop', 'as' => 'shop.','middleware' => 'admin:shop'], function() {

    Route::post('shipping', [OrderController::class, 'shipping'])->name('order.shipping');
    Route::match(['get', 'post'], 'preview', [SpuController::class, 'preview'])->name('preview');
    Route::match(['get', 'post'], 'spu/pick', [SpuController::class, 'pick'])->name('spu.pick');

    Route::resource('spec', SpecController::class);
    Route::resource('category', CategoryController::class);
    Route::resource('brand', BrandController::class);
    Route::resource('spu', SpuController::class);
    Route::resource('sku', SkuController::class);

    Route::post('order/export', [OrderController::class, 'export'])->name('order.export');
    Route::resource('order', OrderController::class);
    Route::resource('delivery', DeliveryController::class);

});
